home *** CD-ROM | disk | FTP | other *** search
/ Ultra Pack / UltraComputing Partner Applications.iso / Faximum / FAXclient / ps / standard.ps
Encoding:
Text File  |  1994-11-16  |  6.2 KB  |  257 lines

  1. %**
  2. %**   The Standard (Letter Size) Preamble File for TIFF Images
  3. %**
  4. %**    COPYRIGHT (C) 1989, 1990 ALL RIGHTS RESERVED
  5. %**    Driver Design Labs division of Clarendon Datex Ltd.
  6. %**     2545 Queens Avenue, West Vancouver, BC, CANADA, V7V 2Y9
  7. %**     Voice: 604 925 2555  FAX: 604 926 8182  UUNET: uunet!faximum!info
  8. %**
  9. %**  WARNING: This file is subject to changes in future versions of the
  10. %**           FAXimum product.  Make changes at your own risk.  (Send us
  11. %**           the good ones, please.)
  12. %**
  13. %** 
  14. %**   The following tuning parameters may be adjusted to improve the operation
  15. %**   of tiffps on your particular postscript printer.  In particular, the
  16. %**   ..._edge variable define (in points) the edges of the printing area.
  17. %**   They may be redefined to any reasonable value.
  18. %** 
  19. %**
  20. %**   SccsId = "@(#)standard.ps    1.4  93/02/25"
  21. %**
  22.  
  23. /left_edge 25 def
  24. /bottom_edge 18 def
  25. /right_edge 598 def
  26. /top_edge 775 def
  27.  
  28. %**  The following parameters apply to the reduced image mode
  29.  
  30. /ileft_edge 25 def
  31. /ibottom_edge 18 def
  32. /iright_edge 598 def
  33. /itop_edge 700 def
  34.  
  35.  
  36. %** The following parameters affect the text printing procedures
  37.  
  38. /textfont /Courier findfont 9 scalefont def
  39. /textlead 11 def
  40. /texttop 750 def
  41. /textleft 50 def
  42.  
  43. /headingfont /Helvetica findfont 10 scalefont def
  44. /headinglead 12 def
  45. /headingtop 765 def
  46. /headingleft 50 def
  47.  
  48. %** 
  49. %**   The special %==name value line(s) define parameters that affect the
  50. %**   operation of tiffps itself.  (tiffps examines the preamble file as it
  51. %**   is read in and uses the %== to set defaults (which may be overridden
  52. %**   on the command line).
  53. %** 
  54. %**     maxheight
  55. %**        defines the maximum length (in inches) tiff image that should be
  56. %**        put on a single page.  Pages longer than this will be broken into
  57. %**        more than one page.  Normally it is set to 14.5 so that legal pages 
  58. %**        will be printed but anything longer will be split up.
  59. %**
  60. %**     paperheight
  61. %**        defines the height of the imaging area (top_edge - bottom_edge) in
  62. %**        inches.  This defines the size an image larger than maxheight will
  63. %**        be broken down into.  If paperheight is larger than the actual
  64. %**        page, then the first n-1 parts of a long page will appear
  65. %**        compressed and the nth (last) part will not (usually).
  66. %**
  67. %**   As an aside, all comments starting with '%**' are NOT copied by tiffps
  68. %**   into the output stream.
  69. %** 
  70.  
  71. %==maxheight 14.6
  72. %==paperheight 10.5
  73.  
  74. %**
  75. %** Procedures for text printing
  76. %**
  77.  
  78. /starttext
  79. {
  80.     textfont setfont
  81.     textleft texttop moveto
  82. } bind def
  83.  
  84. /printtext
  85. {
  86.     currentpoint
  87.     3 -1 roll
  88.     show
  89.     moveto
  90.     0 textlead neg rmoveto
  91. } bind def
  92.  
  93. /endtext
  94. {
  95.     showpage
  96. } bind def
  97.  
  98. %**
  99. %** Procedures for printing headings
  100. %**
  101.  
  102. /startheading
  103. {
  104.     headingfont setfont
  105.     headingleft headingtop moveto
  106. } bind def
  107.  
  108. /heading
  109. {
  110.     currentpoint
  111.     3 -1 roll
  112.     show
  113.     moveto
  114.     0 headinglead neg rmoveto
  115. } bind def
  116.  
  117. /endheading
  118. {
  119. } bind def
  120.  
  121.  
  122.  
  123. /s0 
  124.     dup 1 sub exch string 0 1 4 -1 roll { exch dup 3 -1 roll 0 put } for 
  125.     def 
  126. } bind def
  127.  
  128. /sf 
  129.     dup 1 sub exch string 0 1 4 -1 roll { exch dup 3 -1 roll 255 put } for 
  130.     def 
  131. } bind def
  132.  
  133. /DS 512 string def
  134.  
  135. /# 1000 sf
  136. /^ 1000 s0
  137.  
  138. /gi { # 0 3 -1 roll getinterval def } bind def
  139. /GI { ^ 0 3 -1 roll getinterval def } bind def
  140.  
  141. /a 1 gi   /b 2 gi   /c 3 gi   /d 4 gi   /e 5 gi   
  142. /f 6 gi   /g 7 gi   /h 8 gi   /i 9 gi 
  143. /j 10 gi  /k 20 gi  /l 30 gi  /m 40 gi  /n 50 gi 
  144. /o 60 gi  /p 70 gi  /q 80 gi  /r 90 gi
  145. /s 100 gi /t 200 gi /u 300 gi /v 400 gi /w 500 gi 
  146. /x 600 gi /y 700 gi /z 800 gi /$ 900 gi
  147. /A 1 GI   /B 2 GI   /C 3 GI   /D 4 GI   /E 5 GI
  148. /F 6 GI   /G 7 GI   /H 8 GI   /I 9 GI
  149. /J 10 GI  /K 20 GI  /L 30 GI  /M 40 GI  /N 50 GI
  150. /O 60 GI  /P 70 GI  /Q 80 GI  /R 90 GI
  151. /S 100 GI /T 200 GI /U 300 GI /V 400 GI /W 500 GI
  152. /X 600 GI /Y 700 GI /Z 800 GI /@ 900 GI
  153.  
  154.  
  155. %**
  156. %**  pageinfo takes five arguments from the stack
  157. %**    string: the name of the file from which this image came from
  158. %**    string: the description of this image (from the TIFF directory)
  159. %**    integer: image count - the number of this image in this file
  160. %**        this starts from 1 with every file
  161. %**    integer: page count - the number of this page 
  162. %**        this starts from 1 with every print job
  163. %**    integer: part count - the number of page within an image
  164. %**        this starts from 1 with every image and only goes above 1
  165. %**        when printing an image that spans more than one page
  166. %**
  167. %**  this information is placed into the PostScript data stream by tiffps
  168. %**  to make it possible to add titles and pages numbers to the output...
  169. %**  however, this version of the preamble does not use this information
  170. %**
  171. /pageinfo
  172. {
  173.     pop pop pop pop pop
  174. } bind def
  175.  
  176. %**  pagesetup takes four arguments from the stack
  177. %**    the width (in pixels) of the image
  178. %**    the horizontal resolution (in pixels per inch)
  179. %**    the height (in pixels) of the image
  180. %**    the vertical resolution (in pixels per inch)
  181. %**
  182. /pagesetup
  183. {
  184.     /vres exch def
  185.     /height exch def
  186.     /hres exch def
  187.     /width exch def
  188.  
  189.     left_edge bottom_edge translate
  190.  
  191.     /pwidth right_edge left_edge sub def
  192.     /pheight top_edge bottom_edge sub def
  193.  
  194.     /iwidth width hres div 72 mul round def
  195.     /iheight height vres div 72 mul round def
  196.  
  197.     iheight pheight lt { 0 pheight iheight sub translate } if
  198.  
  199.     iwidth pwidth le { iwidth } { pwidth } ifelse
  200.     iheight pheight le { iheight } { pheight } ifelse
  201.     scale
  202.  
  203.     width height 1 
  204.         width 0 0 height neg 0 height
  205.         6 array
  206.         astore
  207.     { currentfile DS readline pop cvx exec } bind 
  208.     image
  209. } def
  210.  
  211. /ipagesetup
  212. {
  213.     /vres exch 3 mul 2 div def
  214.     /height exch def
  215.     /hres exch 3 mul 2 div def
  216.     /width exch def
  217.  
  218.     left_edge bottom_edge translate
  219.  
  220.     /pwidth iright_edge ileft_edge sub def
  221.     /pheight itop_edge ibottom_edge sub def
  222.  
  223.     /iwidth width hres div 72 mul round def
  224.     /iheight height vres div 72 mul round def
  225.  
  226.     iheight pheight lt { 0 pheight iheight sub translate } if
  227.  
  228.     iwidth pwidth lt { pwidth iwidth sub 2 div 0 translate } if
  229.  
  230.     % draw a box around the image
  231.  
  232.     /bheight iheight pheight lt { iheight } { pheight } ifelse def
  233.  
  234.     0.2 setlinewidth
  235.     newpath
  236.     -1 -1 moveto
  237.     -1 bheight 1 add lineto
  238.     iwidth 1 add bheight 1 add lineto
  239.     iwidth 1 add -1 lineto
  240.     closepath
  241.     stroke
  242.  
  243.     iwidth pwidth le { iwidth } { pwidth } ifelse
  244.     iheight pheight le { iheight } { pheight } ifelse
  245.     scale
  246.  
  247.  
  248.     width height 1 
  249.         width 0 0 height neg 0 height
  250.         6 array
  251.         astore
  252.     { currentfile DS readline pop cvx exec } bind 
  253.     image
  254. } def
  255.